<template>
  <el-row>
    <el-col>
      <el-form :inline="true" :model="formInline" size="small">
        <el-form-item label="收藏名称">
          <el-input v-model="formInline.value1" style="width: 215px" placeholder="收藏名称"></el-input>
        </el-form-item>
        <el-form-item label="收藏类型">
          <el-select v-model="formInline.value2" placeholder="收藏类型">
            <el-option label="全部" value="0"></el-option>
            <el-option label="地图" value="1"></el-option>
            <el-option label="数据" value="2"></el-option>
            <el-option label="文件" value="3"></el-option>
          </el-select>
        </el-form-item>
        <el-form-item label="收藏状态">
          <el-select v-model="formInline.value3" placeholder="收藏状态">
            <el-option label="全部" value="0"></el-option>
            <el-option label="有效" value="1"></el-option>
            <el-option label="失效" value="2"></el-option>
          </el-select>
        </el-form-item>
        <el-form-item label="收藏时间">
          <el-date-picker
              v-model="formInline.value5"
              type="daterange"
              align="right"
              unlink-panels
              range-separator="至"
              start-placeholder="开始日期"
              end-placeholder="结束日期"
              :picker-options="pickerOptions">
          </el-date-picker>
        </el-form-item>
      </el-form>
      <vxe-table :data="tableData">
        <vxe-column type="seq" width="60"></vxe-column>
        <vxe-column field="value1" title="收藏名称"></vxe-column>
        <vxe-column field="value2" title="收藏备注"></vxe-column>
        <vxe-column field="value3" title="收藏类型"></vxe-column>
        <vxe-column field="value4" title="收藏状态"></vxe-column>
        <vxe-column field="value5" title="收藏地址"></vxe-column>
        <vxe-column field="value6" title="收藏时间"></vxe-column>
        <vxe-column title="操作" width="100px">
          <template #default="{ row }">
            <el-button type="text" @click="detailed(row)">详情</el-button>
            <el-button type="text" style="color: #fd3e3e" @click="del(row)">删除</el-button>
          </template>
        </vxe-column>
      </vxe-table>
      <vxe-pager
          :current-page.sync="page.currentPage"
          :page-size.sync="page.pageSize"
          :total="page.totalResult"
          :layouts="['PrevJump', 'PrevPage', 'Number', 'NextPage', 'NextJump', 'FullJump', 'Total']">
      </vxe-pager>
    </el-col>
  </el-row>
</template>

<script>
export default {
  name: "CollectList",
  data() {
    return {
      formInline: {
        value1: '',
        value2: '',
        value3: '',
        value4: '',
        value5: '',
      },
      tableData: [
        {id: '166464161', value1: '收藏数据1', value2: '备注1', value3: '地图', value4: '有效', value5: '//xxx.mmm.com.cn', value6: '2022-07-03'},
        {id: '166464162', value1: '收藏数据2', value2: '备注2', value3: '地图', value4: '失效', value5: '//xxx.mmm.com.cn', value6: '2022-07-04'},
        {id: '166464163', value1: '收藏数据3', value2: '备注3', value3: '地图', value4: '有效', value5: '//xxx.mmm.com.cn', value6: '2022-07-05'},
        {id: '166464164', value1: '收藏数据4', value2: '备注4', value3: '地图', value4: '失效', value5: '//xxx.mmm.com.cn', value6: '2022-07-06'},
        {id: '166464165', value1: '收藏数据5', value2: '备注5', value3: '地图', value4: '有效', value5: '//xxx.mmm.com.cn', value6: '2022-07-07'}
      ],
      page: {
        currentPage: 1,
        pageSize: 10,
        totalResult: 300
      },
    }
  },
  methods: {
    /**
     *{ 详情 }
     * @param:
     * @author: 马凯
     * @DateTime: 2022/7/23
     */
    detailed(row) {
      this.$router.push({
        name: 'CollectDetailed',
        query: {
          id: row.id
        }
      })
    },
    /**
     *{ 删除 }
     * @param:
     * @author: 马凯
     * @DateTime: 2022/7/23
     */
    del(row) {
      this.$confirm(`此操作将永久删除该申请, 是否继续?`, '提示', {
        confirmButtonText: '确定',
        cancelButtonText: '取消',
        type: 'warning'
      }).then(() => {
        this.$message({
          type: 'success',
          message: '删除成功!' + row.value1
        });
      });
    }

  }
}
</script>

<style scoped>

</style>